<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>BoFind的简单搜索</title>
     <script>
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?51cb9545f1c54b9c2d87d3d635fcb3cc";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
    </script> 
</head>
<style type="text/css">
.body_pc{
    position: absolute;
    margin: 0px;
    border: 0px;
    padding: 0px;
    width: 100%;
    height: 100%;
    background-repeat:no-repeat ; 
    background-size:100% 100%; 
    background-attachment: fixed;
}

.body_mob{
    margin: 0px;
    border: 0px;
    padding: 0px;
    background-image:url('https://pic1.zhimg.com/v2-29f166daae3336b13da3ed53fe69d30e_r.jpg?source=1940ef5c');
}

/* 内容div毛玻璃突出 */
.contentmain {
	width: 60%;
    height: 45%;
	position:relative;
	margin:10rem auto;
	padding:5em;
	
}
.contentmain:hover{
    margin-top: 10.2rem;
    background:hsla(0,0%,100%,.25) border-box;
	overflow:hidden;
	border-radius:8px;
	box-shadow:0 0 0 1px hsla(0,0%,100%,.3) inset,0 .5em 1em rgba(0,0,0,0.6);
	text-shadow:0 1px 1px hsla(0,0%,100%,.3);
}
.contentmain:hover:before {
	content:'';
	position:absolute;
	top:0;
	right:0;
	bottom:0;
	left:0;
	margin:-30px;
	z-index:-1;
	-webkit-filter:blur(10px);
	filter:blur(5px);
    opacity: 0.9;
}



.div_input{
    width:800px;
    margin: 0px auto;
}
input {outline:none;}
.input_default{ 
        width:675px; height:36px;
        margin-left: auto;
        margin-right: auto; 
        text-indent: 15px;font-size:20px; 
        border:1px solid #d2d2d6;border-radius: 6px;
        background: rgb(212, 212, 208);
        
        }
.input_default:hover{
        border:1px solid #8780f5;border-radius: 6px;        
        }     
      
.input_focus{
        width:675px; height:36px;   
        margin: 0px auto;
        text-indent: 15px;font-size:20px; 
        border:1px solid #2f36ec;border-radius: 6px;
        background: rgb(241, 241, 239);
        }

.ul_sw{
    list-style-type:none;
    width:675px;
    margin-top: 0px;
    text-indent: 15px;font-size:15px; 
    border:1px solid #8780f5;border-radius: 6px;
    background: rgb(240, 240, 239);
    padding: 0px;
}
.li_sw{
    height: 30px;
}
.li_sw:hover{
    color: #181bf3;
    cursor:pointer
}

.div_anniu{
    width:800px;
    margin-left: auto;margin-right: auto;
    margin-top: 10px;
}
.anniu_all{
    width: 88px;
    padding: 2px;
    font-size:20px;text-align: center;
    border-radius:7.5px; border:2px solid #fbfafc;
    margin: 8px;
}
.anniu_all:hover{border:2px solid #3c2ef8;}
#anniu1{
   background: rgb(156, 221, 247);
}
#anniu2{
     background: rgb(68, 143, 93)
}

#anniu3{
    background: rgb(137, 240, 117)
}
#anniu4{
    background: rgb(69, 113, 235)
}
#anniu5{
     background: rgb(209, 85, 147)
}
#anniu6{
    color: #fbfafc; background: #24292e
}

#caidan{
    width:190px;
    margin: 0px;
    padding: 3px;
    border:1px solid #f5f5f7;border-radius:4px;
    background-color:rgb(240, 121, 43);
    font-size: 20px;
    text-align: center;
    color: beige;
    
}
</style>
<script>//搜索方式函数
    function Search_BaiDu()
    {
        window.open("https://www.baidu.com/s?ie=UTF-8&wd="+document.getElementById("textid").value);
    }
    function Search_Bilibili()
    {
        window.open("https://search.bilibili.com/all?keyword=" +document.getElementById("textid").value+ "&from_source=banner_search");
    }
    function Search_Google()
    {
        window.open("https://www.google.com/search?newwindow=1&safe=strict&hl=zh-CN&gbv=2&q="+document.getElementById("textid").value);
    }
    function Search_Bing()
    {
        window.open("https://cn.bing.com/search?q=" +document.getElementById("textid").value+ "&qs=n&FORM=BESBTB&sp=-1&pq=&sc=0-0&sk=&cvid=D4344541005214407A3E5624649B01D92&ensearch=1");
    }
    function Search_ZhiHu()
    {
        window.open("https://www.zhihu.com/search?type=content&q="+document.getElementById("textid").value);
    }
    function Search_GitHub()//github的click函数重写
    {
                window.open("https://github.com/search?p=3&q="+document.getElementById("textid").value+"&type=Repositories");
    }
    function Search_SouGou()
    {
                window.open("https://www.sogou.com/web?query="+document.getElementById("textid").value);
    }
    function Search_WXacount()
    {
                window.open("https://weixin.sogou.com/weixin?type=1&query="+document.getElementById("textid").value);
    }
    function Search_WXarticle()
    {
                window.open("https://weixin.sogou.com/weixin?type=2&query="+document.getElementById("textid").value);
    }
    function Search_GoogleT_En()
    {
                window.open("https://translate.google.cn/#view=home&op=translate&sl=auto&tl=en&text="+document.getElementById("textid").value);
    }
    function Search_GoogleT_Cn()
    {
                window.open("https://translate.google.cn/#view=home&op=translate&sl=auto&tl=zh-CN&text="+document.getElementById("textid").value);
    }
    function Search_YDtrans()
    {
                window.open("http://fanyi.youdao.com");
    }
</script>

<script>//快捷键 鼠标
 function contentmenter()//毛玻璃突出
    {
        document.getElementById("textid").style.background="rgb(250, 250, 250)";

    }
    function contentmleave()
    {
        document.getElementById("textid").style.background="rgb(212, 212, 208)";
    }

    function mousedo()//鼠标点击输入框
    {
       document.getElementById("textid").className="input_focus";
    }

    function mouseout()//鼠标外出输入框
    {

        var input1=document.getElementById("textid");
        input1.className="input_default";
    }
    function enter_key() 
            {
                Search_BaiDu();
            }
   
    document.onkeydown=function()
    {
        var keyNum=event.keyCode;
        if(keyNum==13)//回车 集中
        {
            var input1=document.getElementById("textid");
            input1.className="input_focus";
            input1.focus();
            
        }//
        else  if(keyNum==34)//dn键 
        {
            location.href="index2.html";                
        }else  if(keyNum==33)//up键 
        {
            location.href="index3.html";                
        }
        // if(keyNum==40)
        // {
        //     input1_sw1()
        // }
        
    }
      
   
    function inpt_keydown()
    {
        if(window.event.keyCode==66&&event.altKey)
        {
            Search_Bilibili()
        }else if(window.event.keyCode==90&&event.altKey)
        {
            Search_ZhiHu();
        }
        else if(window.event.keyCode==67&&event.altKey)
        {
            document.getElementById("textid").value="";
        }
        else if(window.event.keyCode==13)
        {
            Search_BaiDu();
        }else if(window.event.keyCode==71&&event.altKey)//g
        {
            Search_GitHub();
        }else if(window.event.keyCode==83&&event.altKey)//s
        {
            Search_SouGou();
        }else if(window.event.keyCode==87&&event.altKey)//w
        {
            Search_WXarticle();
        }else if(window.event.keyCode==74&&event.altKey)//H候选词
        {
            input1_sw0();
        }
        else if(window.event.keyCode==75&&event.altKey)//K
        {
            input1_sw1();
        }else if(window.event.keyCode==76&&event.altKey)//L
        {
            input1_sw2();
        }else if(window.event.keyCode==186&&event.altKey)//L
        {
            input1_sw3();
        }
        else if(window.event.keyCode==222&&event.altKey)//L
        {
            input1_sw4();
        }     
    }
</script>
<script>//背景随机切换----页面加载就切换
    //生成从minNum到maxNum的随机数
    function randomNum(minNum,maxNum){ 
        switch(arguments.length){ 
            case 1: 
                return parseInt(Math.random()*minNum+1,10); 
            break; 
            case 2: 
                return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
            break; 
                default: 
                    return 0; 
                break; 
        } 
    }  
    function bgimgchang()
    {
        var arr =[
        "https://pic3.zhimg.com/9d7bd19f7d7f3334298914b27e5ee557_r.jpg?",
        "https://pic1.zhimg.com/v2-cfac1fc3256bf128a9be4a539c7a12f4_r.jpg",
        "https://pic2.zhimg.com/v2-c3e869051a97652c5cd0289e8a9005a4_r.jpg?",
        "https://pic2.zhimg.com/v2-823ca5af9946a8e34712cae699650bb8_r.jpg?",
        "https://pic3.zhimg.com/v2-ff0bf88c3ae2817aabbe0a3346b57547_r.jpg?",
        "https://pic3.zhimg.com/v2-0a9155a93023835b968721718714ed42_r.jpg",
        "https://pic1.zhimg.com/v2-1d94747a0a2e8b6a7fea9383cc6006cc_r.jpg"

        ];
        rand=randomNum(0,6);
        console.log(rand);
        document.body.style.backgroundImage="url("+arr[rand]+")";
    
    }

</script>

<script>//页面时间显示
    window.onload=function(){
        //每1秒刷新时间
        setInterval("f()",1000);
        bgimgchang();
    }
    function f() {      
        var nowDate=new Date().toLocaleString();
        if(document.getElementById("timenow")){
            document.getElementById("timenow").innerText=nowDate;
        }  
    }
</script>

<body>
    <script>//判断pc
        if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i))) {
            document.body.className="body_mob"
        }else{
            document.body.className="body_pc"
        }
    </script>
<!--本地图片//G:/Pictures/海.jpg    网络图片HTTP开头--> 
    <div id="caidan">按Up/Dn键，有彩蛋</div>    
    <div class="contentmain" onmouseenter="contentmenter()" onmouseleave="contentmleave()">
        <div class="div_input">
            <input id="textid" type="text" class="input_default" onmouseout=mouseout() onmousedown=mousedo() onkeydown=inpt_keydown()  onkeyup=BD_suKW()>
        </div>
        <div id="div_swid" style="display: none;width: 800px;margin: 0 auto;">
            <ul class="ul_sw">
                <li id="li0" class="li_sw" onmousedown=input1_sw0()></li>
                <li id="li1" class="li_sw" onmousedown=input1_sw1()></li>
                <li id="li2" class="li_sw" onmousedown=input1_sw2()></li>
                <li id="li3" class="li_sw" onmousedown=input1_sw3()></li>
                <li id="li4" class="li_sw" onmousedown=input1_sw4()></li>
            </ul>
        </div>
        <div class="div_anniu">    
            <b>
                    <input id="anniu1" type="button" value="百度" class="anniu_all" onclick=Search_BaiDu() > 
                    <input id="anniu4" type="button" value="知乎" class="anniu_all" onclick=Search_ZhiHu() >
                    <input id="anniu5" type="button" value="B站" class="anniu_all" onclick=Search_Bilibili()>
                    <input id="anniu6" type="button" value="GitHub" class="anniu_all" onclick=Search_GitHub() >
                    <input id="anniu2" type="button" value="Bing国际版" class="anniu_all" onclick=Search_Bing()>
                    <input id="anniu3" type="button" value="谷歌"  class="anniu_all" onclick=Search_Google()>
            </b><br>
            <b>
                <input type="button" value="搜狗" class="anniu_all" onclick=Search_SouGou() style="background-color: coral;"> 
            </b> <br>
            <b>
                <input type="button" value="公众号文" class="anniu_all" onclick=Search_WXarticle() style="background-color: rgb(5, 143, 35);">
                <input type="button" value="公众号" class="anniu_all" onclick=Search_WXacount() style="background-color: rgb(58, 139, 76);">
            </b><br>
            <b>
                <input type="button" value="英->中" class="anniu_all" onclick=Search_GoogleT_Cn() style="background-color: #1A73EB;">
                <input type="button" value="中->英" class="anniu_all" onclick=Search_GoogleT_En() style="background-color: #4e95f1;">
                <input type="button" value="有道翻译" class="anniu_all" onclick=Search_YDtrans() style="background-color: #e02433;">
            </b>

        </div>
        
        
        
    </div>
    <div id="timenow" style="width: 90%; position: absolute;bottom: 10px; text-align:center;font-size: 20px; color: rgb(249, 247, 252);"></div> 

</body>

<script type="text/javascript">//ajax -候选词
    function BD_suKW()
    {
        var keyworld=document.getElementById("textid").value; 
        if(keyworld=="")
        { 
            li_swClaer();
        }
        else{ 
                //document.getElementById("script_9").remove();
                var oScript = document.createElement('script');
                oScript.id="script_9";
                oScript.src = 'https://www.baidu.com/sugrec?ie=utf-8&json=1&prod=pc&wd='+keyworld+'&cb=Scri_RB';  //Scri_RB 回调函数
                document.body.appendChild(oScript);
                document.getElementById("script_9").remove();//删除新创建的脚本   
            }
    }
    function Scri_RB(data) 
    {//回调函数
	    //console.log(data);
        
        var lis_kw=data.g;  
        try {var len=lis_kw.length } catch (error) {return}
        //console.log(lis_kw)   
        if(len)
        {
            //console.log(lis_kw);
            for (var i=0;i<5&&i<len;i++){document.getElementById("li"+i).innerHTML=lis_kw[i].q;}
            document.getElementById("div_swid").style.display="block";
        }else{
            document.getElementById("div_swid").style.display="none";
        }
        //            
    }
    function input1_sw0()
    {
        document.getElementById("textid").value=document.getElementById("li0").innerHTML;
        li_swClaer();
        
    }
    function input1_sw1()
    {
        document.getElementById("textid").value=document.getElementById("li1").innerHTML;
        li_swClaer();
    }
    function input1_sw2()
    {
        document.getElementById("textid").value=document.getElementById("li2").innerHTML;
        li_swClaer();
    }
    function input1_sw3()
    {
        document.getElementById("textid").value=document.getElementById("li3").innerHTML;
        li_swClaer();
    }
    function input1_sw4()
    {
        document.getElementById("textid").value=document.getElementById("li4").innerHTML;
        li_swClaer();
    }
    function li_swClaer()
    {
        document.getElementById("div_swid").style.display="none";
        document.getElementById("li0").innerHTML="";
        document.getElementById("li1").innerHTML="";
        document.getElementById("li2").innerHTML="";
        document.getElementById("li3").innerHTML="";
        document.getElementById("li4").innerHTML="";
    }
</script>

</html>